import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userUnionId:'',
  },
  getters: {
  },
  mutations: {
    reducePriceone:(context,data) => {
      context.userUnionId = data.userUnionId
  },
  },
  actions: {
    reducePrice:(context,data) => {
      context.commit('reducePriceone',data)
      // sessionStorage存储
      sessionStorage.setItem('token', data.token)
      sessionStorage.setItem('userUnionId', data.userUnionId)
      //打印token
      // console.log('token:'+sessionStorage.getItem('token'))
    }
  }
})